Design the following functions:
;; characters-in : Sos -> Number
;; characters-in-loss : LoSS -> Number
;; RETURNS: the total number of characters in the strings
;; EXAMPLE/TEST:
(begin-for-test
(check-equal?
(characters-in
(list "alice"
(list (list "alice" "bob") "carole")
"dave"))
23)
;; subst : SoS String String -> SoS
;; GIVEN: a SoS and two strings, old and new
;; RETURNS: a sos just like the given one, except that
;; all instances of old are changed to new.
;; EXAMPLE/TEST:
(begin-for-test
(check-equal?
(subst
(list "alice"
(list (list "alice" "bob") "dave")
"eve"
"bob")
"bob"
"ted")
(list "alice"
(list (list "alice" "ted") "dave")
"eve"
"ted")))
Last modified: Thu Oct 9 15:16:51 Eastern Daylight Time 2014